package com.ruoyi.factorydata.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.factorydata.mapper.CraftProcessStationRelationMapper;
import com.ruoyi.factorydata.domain.CraftProcessStationRelation;
import com.ruoyi.factorydata.service.ICraftProcessStationRelationService;

/**
 * 工艺工序工位Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-15
 */
@Service
public class CraftProcessStationRelationServiceImpl extends ServiceImpl<CraftProcessStationRelationMapper, CraftProcessStationRelation> implements ICraftProcessStationRelationService {
    @Autowired
    private CraftProcessStationRelationMapper craftProcessStationRelationMapper;

    /**
     * 查询工艺工序工位
     *
     * @param id 工艺工序工位主键
     * @return 工艺工序工位
     */
    @Override
    public CraftProcessStationRelation selectCraftProcessStationRelationById(Long id) {
        return craftProcessStationRelationMapper.selectCraftProcessStationRelationById(id);
    }

    /**
     * 查询工艺工序工位列表
     *
     * @param craftProcessStationRelation 工艺工序工位
     * @return 工艺工序工位
     */
    @Override
    public List<CraftProcessStationRelation> selectCraftProcessStationRelationList(CraftProcessStationRelation craftProcessStationRelation) {
        return craftProcessStationRelationMapper.selectCraftProcessStationRelationList(craftProcessStationRelation);
    }

    /**
     * 新增工艺工序工位
     *
     * @param craftProcessStationRelation 工艺工序工位
     * @return 结果
     */
    @Override
    public int insertCraftProcessStationRelation(CraftProcessStationRelation craftProcessStationRelation) {
                craftProcessStationRelation.setCreateTime(DateUtils.getNowDate());
            return craftProcessStationRelationMapper.insertCraftProcessStationRelation(craftProcessStationRelation);
    }

    /**
     * 修改工艺工序工位
     *
     * @param craftProcessStationRelation 工艺工序工位
     * @return 结果
     */
    @Override
    public int updateCraftProcessStationRelation(CraftProcessStationRelation craftProcessStationRelation) {
                craftProcessStationRelation.setUpdateTime(DateUtils.getNowDate());
        return craftProcessStationRelationMapper.updateCraftProcessStationRelation(craftProcessStationRelation);
    }

    /**
     * 批量删除工艺工序工位
     *
     * @param ids 需要删除的工艺工序工位主键
     * @return 结果
     */
    @Override
    public int deleteCraftProcessStationRelationByIds(Long[] ids) {
        return craftProcessStationRelationMapper.deleteCraftProcessStationRelationByIds(ids);
    }

    /**
     * 删除工艺工序工位信息
     *
     * @param id 工艺工序工位主键
     * @return 结果
     */
    @Override
    public int deleteCraftProcessStationRelationById(Long id) {
        return craftProcessStationRelationMapper.deleteCraftProcessStationRelationById(id);
    }
}